<?php
	// twitter
	$sql = "select a.* 
			from tbl_link a 
			where 	a.stsrc = 'A' 
				and a.linkstatus = 1 
				and a.linkcategory = 'twitter'
			limit 0,1
			";
	$exe = mysql_query($sql) or die(mysql_error());
	$num = mysql_num_rows($exe);
	$row = mysql_fetch_array($exe);
	
	// facebook
	$sql2 = "select a.* 
		from tbl_link a 
		where 	a.stsrc = 'A' 
			and a.linkstatus = 1 
			and a.linkcategory = 'facebook'
		limit 0,1
		";
	$exe2 = mysql_query($sql2) or die(mysql_error());
	$num2 = mysql_num_rows($exe2);
	$row2 = mysql_fetch_array($exe2);
	
	if($row > 0 || $row2 > 0)
	{
?>
<div style="padding:54px 20px 0 0;">
	<table border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td style="padding-right:5px;" valign="middle">Follow Us : </td>
			<?php if($num > 0){ ?><td style="padding-right:5px;"><a target="_blank" href="<?php echo $row['linkurlhref'] ?>" ><img src="<?php echo getURLdomain(); ?>/source/global/img/twitter-logo/twitter-logo.png" width="24" height="24" /></a></td><?php } ?>
			<?php if($num2 > 0){ ?><td style="padding-right:5px;"><a target="_blank" href="<?php echo $row2['linkurlhref'] ?>" ><img src="<?php echo getURLdomain(); ?>/source/global/img/facebook-logo/facebook-logo.png" width="24" height="24" /></a></td><?php } ?>
		</tr>
	</table>
</div>
<?php
	}
?>